home *** CD-ROM | disk | FTP | other *** search
- /* Write a new netmail message. */
-
- #include "mb_lib.h"
- #include <string.h>
- #include <stdio.h>
-
- M_TEXT txt; /* Text handle */
- NET_RECORD hdr; /* Netmail header */
-
- #define NMPATH "C:\\MSGBASE" /* Let's be lazy and do it this way */
-
- main () {
- txt = txt_new ("This is a netmail message. "); /* First, create text */
- txt_add (txt, "As you can see, writing one is quite easy.\r\r");
- txt_add (txt, "Bye!\r");
- net_hdr_clear (& hdr);
- strcpy (hdr.who_from, "Frank Van.wensveen"); /* Then, build a header */
- strcpy (hdr.who_to, "SysOp");
- strcpy (hdr.subject, "Demo");
- hdr.dest_node = 703; /* From 2:285/504.1 to 27:1331/703.2 */
- hdr.orig_node = 504;
- hdr.orig_net = 285;
- hdr.dest_net = 1331;
- hdr.dest_zone = 27;
- hdr.orig_zone = 2;
- hdr.dest_point = 2;
- hdr.orig_point = 1;
- hdr.attribute = NM_LOCAL | NM_KILL;
- net_fixup4d (& hdr, txt); /* Create INTL and FMPT/TOPT kludge */
- if (net_write (NMPATH, net_last (NMPATH) + 1, & hdr, txt)) /* Write it */
- printf ("Error %d writing netmail:\n%s\n", errortype, errorstring);
- return (0);
- }